package com.xjust.controller.check;

import com.xjust.pojo.Result;
import com.xjust.pojo.ResultBean;
import com.xjust.service.CheckRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/checkRequests")
public class CheckRequestController {
    @Autowired
    CheckRequestService checkRequestService;
    //获取患者列表
    @GetMapping("/getPatientList")
    public Result getPatientList(Integer page,Integer pageSize,String realName,String caseNumber){
        ResultBean list = checkRequestService.getPatientList(page,pageSize,realName,caseNumber);
        return Result.success(list);
    }
    //获取已完成患者数量
    @GetMapping("/getFinishPatientList")
    public Result getFinishPatientList(){
        Integer count = checkRequestService.getFinishPatientList();
        return Result.success(count);
    }
    //获取等待患者数量
    @GetMapping("/getWaitPatientList")
    public Result getWaitPatientList(){
        Integer count = checkRequestService.getWaitPatientList();
        return Result.success(count);
    }
    //录入患者检查信息
    @PutMapping("/submitCheckRequest")
    public Result submitCheckRequest(Integer employeeId,Integer registId,Integer medicalTechnology){
        checkRequestService.submitCheckRequest(employeeId,registId,medicalTechnology);
        return Result.success();
    }
    //提交检查结果
    @PutMapping("/submitToCheckRequest")
    public Result submitToCheckRequest(String textarea,Integer registId,Integer medicalTechnology,Integer employeeId){
        checkRequestService.submitToCheckRequest(textarea,registId,medicalTechnology,employeeId);
        return Result.success();
    }
    //获取选中项检查表
    @GetMapping("/selectCheck")
    public Result selectCheck(Integer checkId){
        Map<String,Object> list = checkRequestService.selectCheck(checkId);
       return Result.success(list);
    }


}
